#[cfg(any(feature = "mysql"))]
pub type SqlID = u64;
#[cfg(any(feature = "postgres"))]
pub type SqlID = i64;
#[cfg(any(feature = "sqlite"))]
pub type SqlID = i32;

// time_zone: https://github.com/launchbadge/sqlx/issues/329
#[cfg(any(feature = "mysql", feature = "postgres"))]
type SqlDateTime = Option<chrono::NaiveDateTime>;
// type SqlDateTime = chrono::NaiveDateTime;

// Extend derive(FromRow): https://github.com/launchbadge/sqlx/issues/156
#[cfg(any(feature = "sqlite"))]
type SqlDateTime = Option<String>;

#[derive(FromRow, Debug, Clone, Deserialize, Serialize)]
pub struct History {
  pub id: SqlID,
  pub method: String,
  pub url: String,
  pub params: Option<String>,
  pub headers: Option<String>,
  pub body: Option<String>,
  pub response: Option<String>,
  pub create_time: SqlDateTime,
}
